import Request from '@/utils/axios'

/**
 * 新增知识分类
 */
export function addKnowledgeCategory(data: any) {
    return Request.post('/knowledge/v1/category/add', data)
}

/**
 * 修改知识分类
 */
export function editKnowledgeCategory(data: any) {
    return Request.post(`/knowledge/v1/category/edit/${data.id}`, data)
}

/**
 * 删除知识分类
 */
export function deleteKnowledgeCategory(data: any) {
    return Request.post('/knowledge/v1/category/delete', data)
}

/**
 * 查询知识分类树
 */
export function getKnowledgeCategoryTree(data: any) {
    return Request.post('/knowledge/v1/category/tree', data)
}

/**
 * 查询知识分类
 */
export function getKnowledgeCategoryList(data: any) {
    return Request.post('/knowledge/v1/category/list', data)
}

/**
 * 新增知识库知识
 */
export function addKnowledge(data: any) {
    return Request.post('/knowledge/v1/entry/add', data)
}

/**
 * 修改知识库知识
 */
export function editKnowledge(data: any) {
    return Request.post(`/knowledge/v1/entry/edit/${data.id}`, data)
}

/**
 * 删除知识库知识
 */
export function deleteKnowledge(data: any) {
    return Request.post('/knowledge/v1/entry/delete', data)
}

/**
 * 查询知识库知识(分页)
 */
export function getKnowledgePageList(data: any) {
    return Request.post('/knowledge/v1/entry/page/list', data)
}

/**
 * 查询知识库知识
 */
export function getKnowledgeList(data: any) {
    return Request.post('/knowledge/v1/entry/list', data)
}

/**
 * 查询知识库知识详情
 */
export function getKnowledge(data: any) {
    return Request.post(`/knowledge/v1/entry/get/${data.id}`, data)
}